<html>
<head>
  <meta HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=ISO-8859-1">
  <title>Contents.m</title>
<link rel="stylesheet" type="text/css" href="../stpr.css">
</head>
<body>
<table  border=0 width="100%" cellpadding=0 cellspacing=0><tr valign="baseline">
<td valign="baseline" class="function"><b class="function">SVMQUADPROG</b>
<td valign="baseline" align="right" class="function"><a href="../svm/index.html" target="mdsdir"><img border = 0 src="../up.gif"></a></table>
  <p><b>SVM trained by Matlab Optimization Toolbox.</b></p>
  <hr>
<div class='code'><code>
<span class=help></span><br>
<span class=help>&nbsp;<span class=help_field>Synopsis:</span></span><br>
<span class=help>&nbsp;&nbsp;model&nbsp;=&nbsp;svmquadprog(&nbsp;data&nbsp;)</span><br>
<span class=help>&nbsp;&nbsp;model&nbsp;=&nbsp;svmquadprog(&nbsp;data,&nbsp;options&nbsp;)</span><br>
<span class=help></span><br>
<span class=help>&nbsp;<span class=help_field>Description:</span></span><br>
<span class=help>&nbsp;&nbsp;This&nbsp;function&nbsp;trains&nbsp;binary&nbsp;Support&nbsp;Vector&nbsp;Machines&nbsp;classifer&nbsp;</span><br>
<span class=help>&nbsp;&nbsp;with&nbsp;L1&nbsp;or&nbsp;L2-soft&nbsp;margin.&nbsp;The&nbsp;SVM&nbsp;quadratic&nbsp;programming&nbsp;task&nbsp;</span><br>
<span class=help>&nbsp;&nbsp;is&nbsp;solved&nbsp;by&nbsp;the&nbsp;'quadprog.m'&nbsp;of&nbsp;the&nbsp;Matlab&nbsp;Optimization&nbsp;toolbox.</span><br>
<span class=help></span><br>
<span class=help>&nbsp;&nbsp;See&nbsp;'help&nbsp;svmclass'&nbsp;to&nbsp;see&nbsp;how&nbsp;to&nbsp;classify&nbsp;data&nbsp;with&nbsp;found&nbsp;classifier.</span><br>
<span class=help>&nbsp;&nbsp;</span><br>
<span class=help>&nbsp;<span class=help_field>Input:</span></span><br>
<span class=help>&nbsp;&nbsp;data&nbsp;[struct]&nbsp;Binary&nbsp;labeled&nbsp;training&nbsp;data:</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.X&nbsp;[dim&nbsp;x&nbsp;num_data]&nbsp;Vectors.</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.y&nbsp;[1&nbsp;x&nbsp;num_data]&nbsp;Training&nbsp;labels.</span><br>
<span class=help></span><br>
<span class=help>&nbsp;&nbsp;options&nbsp;[struct]&nbsp;Control&nbsp;parameters:</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.ker&nbsp;[string]&nbsp;Kernel&nbsp;identifier&nbsp;(default&nbsp;'linear').&nbsp;</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;See&nbsp;'help&nbsp;kernel'&nbsp;for&nbsp;more&nbsp;info.</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.arg&nbsp;[1&nbsp;x&nbsp;nargs]&nbsp;Kernel&nbsp;argument(s).</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.C&nbsp;SVM&nbsp;regularization&nbsp;constant&nbsp;(default&nbsp;inf):</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[1&nbsp;x&nbsp;1]&nbsp;..&nbsp;the&nbsp;same&nbsp;for&nbsp;all&nbsp;training&nbsp;vectors.</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[1&nbsp;x&nbsp;2]&nbsp;..&nbsp;for&nbsp;each&nbsp;class&nbsp;separately&nbsp;C=[C1,C2],</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[1&nbsp;x&nbsp;num_data]&nbsp;..&nbsp;each&nbsp;training&nbsp;vector&nbsp;separately.</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.norm&nbsp;[1x1]&nbsp;1&nbsp;..&nbsp;L1-soft&nbsp;margin&nbsp;penalization&nbsp;(default).</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2&nbsp;..&nbsp;L2-soft&nbsp;margin&nbsp;penalization.</span><br>
<span class=help></span><br>
<span class=help>&nbsp;<span class=help_field>Output:</span></span><br>
<span class=help>&nbsp;&nbsp;model&nbsp;[struct]&nbsp;Binary&nbsp;SVM&nbsp;classifier:</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.Alpha&nbsp;[nsv&nbsp;x&nbsp;1]&nbsp;Weights.</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.b&nbsp;[1x1]&nbsp;Bias&nbsp;of&nbsp;the&nbsp;decision&nbsp;function.</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.sv.X&nbsp;[dim&nbsp;x&nbsp;nsv]&nbsp;Support&nbsp;vectors.</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.nsv&nbsp;[1x1]&nbsp;Number&nbsp;of&nbsp;support&nbsp;vectors.</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.kercnt&nbsp;[1x1]&nbsp;Number&nbsp;of&nbsp;used&nbsp;kernel&nbsp;evaluations.</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.trnerr&nbsp;[1x1]&nbsp;Training&nbsp;classification&nbsp;error.</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.margin&nbsp;[1x1]&nbsp;Margin&nbsp;of&nbsp;found&nbsp;classifier.</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.cputime&nbsp;[1x1]&nbsp;Used&nbsp;CPU&nbsp;time&nbsp;in&nbsp;seconds.</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.options&nbsp;[struct]&nbsp;Copy&nbsp;of&nbsp;used&nbsp;options.</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.exitflag&nbsp;[1x1]&nbsp;Exitflag&nbsp;of&nbsp;the&nbsp;QUADPROG&nbsp;function.&nbsp;</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(if&nbsp;&gt;&nbsp;0&nbsp;then&nbsp;it&nbsp;has&nbsp;converged&nbsp;to&nbsp;the&nbsp;solution).</span><br>
<span class=help></span><br>
<span class=help>&nbsp;<span class=help_field>Example:</span></span><br>
<span class=help>&nbsp;&nbsp;data&nbsp;=&nbsp;load('riply_trn');</span><br>
<span class=help>&nbsp;&nbsp;options&nbsp;=&nbsp;struct('ker','rbf','arg',1,'C',10);</span><br>
<span class=help>&nbsp;&nbsp;model&nbsp;=&nbsp;svmquadprog(data,options)</span><br>
<span class=help>&nbsp;&nbsp;figure;&nbsp;ppatterns(data);&nbsp;psvm(model);</span><br>
<span class=help></span><br>
<span class=help>&nbsp;<span class=also_field>See also </span><span class=also></span><br>
<span class=help><span class=also>&nbsp;&nbsp;<a href = "../svm/smo.html" target="mdsbody">SMO</a>,&nbsp;<a href = "../svm/svmlight.html" target="mdsbody">SVMLIGHT</a>,&nbsp;<a href = "../svm/svmclass.html" target="mdsbody">SVMCLASS</a>.</span><br>
<span class=help></span><br>
</code></div>
  <hr>
  <b>Source:</b> <a href= "../svm/list/svmquadprog.html">svmquadprog.m</a>
  <p><b class="info_field">About: </b>  Statistical Pattern Recognition Toolbox<br>
 (C) 1999-2003, Written by Vojtech Franc and Vaclav Hlavac<br>
 <a href="http://www.cvut.cz">Czech Technical University Prague</a><br>
 <a href="http://www.feld.cvut.cz">Faculty of Electrical Engineering</a><br>
 <a href="http://cmp.felk.cvut.cz">Center for Machine Perception</a><br>

  <p><b class="info_field">Modifications: </b> <br>
 31-may-2004, VF<br>
 16-may-2004, VF<br>
 17-Feb-2003, VF<br>
 28-Nov-2001, VF, used quadprog instead of qp<br>
 23-Occt-2001, VF<br>
 19-September-2001, V. Franc, renamed to svmmot.<br>
 8-July-2001, V.Franc, comments changed, bias mistake removed.<br>
 28-April-2001, V.Franc, flps counter added<br>
 10-April-2001, V. Franc, created<br>

</body>
</html>
